<div class="admin">
    <div class="tab panel dux-box admin-panel">
        <div class="panel-head"><strong>店铺管理</strong></div>
        <div class="padding border-bottom">
            <a href="JavaScript:void(0);" class="button button-small border-green">店铺管理</a>
            <a href="{:U('add')}" class="button button-small border-green">添加</a>
        </div>
        <div class="fixed-empty"></div>
        <form method="post" action="{:U('index')}" name="formSearch" id="formSearch">
        <table class="table tb-type2">
            <tbody>
                <tr>
                    <td width="8%"><label style="font-weight: bold;">店铺名称：</label></td>
                    <td width="20%"><input class="input" type="text" name="store_name" value="" /></td>
                    <td width="10%"><button class="button bg-blue" type="submit">查询</button></td>
                    <td width="*"></td>
                </tr>
            </tbody>
        </table>
        </form>

        <form name="myform" id="myform" action="" method="post">
            <table class="table tb-type2 nobdb">
                <thead>
                    <tr class="thead">
                        <th width="4%">编号</th>
                        <th width="4%">LOGO</th>
                        <th width="5%">域名</th>
                        <th width="5%">联系人</th>
                        <th width="10%">电话</th>
                        <th width="*">公司名称</th>
                        <th width="4%">销量</th>
                        <th width="10%">开店时间</th>
                        <th width="6%">状态</th>
                        <th width="20%">操作</th>
                    </tr>
                </thead>
                <tbody>
                <foreach item="v" name="list">
                    <tr class="hover">
                        <td>{$v['store_id']}</td>
                        <td><img src="{$v['store_label']}" height="35" width="35" /></td>
                        <td>{$v['store_domain']}</td>
                        <td>{$v['member_name']}</td>
                        <td>{$v['store_phone']}</td>
                        <td>{$v['store_company_name']}</td>
                        <td>{$v['store_sales']}</td>
                        <td>{$v['store_time']|date="Y-m-d",###}</td>
                        <td>
                        <if condition="$v['store_state'] eq 1">
                            <a class="button bg-green button-little"><i class="icon-check"></i>审核</a>
                            <else />
                            <a class="button bg-gray button-little"><i class="icon-times"></i>审核</a>
                        </if>
                        </td>
                        <td class="w144 align-center">
                            <a class="button bg-green button-little" href="{:U('details',array('id'=>$v['member_id']))}"><i class="icon-ellipsis-h"></i>详情</a> 
                            <a class="button bg-red button-little" title="删除" data="{$v['store_id']}"><i class="icon-minus-circle"></i>删除</a> 
                            <a class="button bg-green button-little" href="javascript:" data="1" title="推荐" onclick="tuijian({$v['store_id']})"><i class="icon-thumbs-up"></i>推荐</a>
                            <a class="button bg-blue button-little" onclick="chongzhi({$v['member_id']})"><i class="icon-unlock-alt"></i>改密</a>
                        </td>
                    </tr>
                </foreach>
                </tbody>
                <tfoot class="panel-foot">
                    <tr>
                        <td colspan="10"><div class="pages clearfix">{$page}</div></td>
                    </tr>
                </tfoot>
            </table>
        </form>
    </div>
</div>
<script type="text/javascript">
    $('#myform').layer({
    actionUrl: "batchAction",
            deleteUrl: "{:U('delete')}",
    });
    function tuijian(dete)
    {
    layer.confirm(
            '确定推荐此商店吗？',
    {btn: ['是的', '算了']},
            function () {
            dete = {store_id: dete};
            var p = Aajax("{:ADMIN_URL}{:U('Store/store_tuijian')}", dete);
            if (p.n){
            layer.msg('商品推荐成功');
            setTimeout("history.go(0)", 1500);
            } else{
            layer.msg('出错请稍后再试');
            }
            },
            function(){}
    );
    }

    function chongzhi(dete)
    {
    layer.confirm(
            '确定要重置该商家的密码？',
    {btn: ['是的', '算了']},
            function () {
            dete = {user_id: dete};
            var p = Aajax("{:ADMIN_URL}{:U('Store/store_chongzhi')}", dete);
            if (p.p){
            layer.msg('密码已重置为123456');
            } else{
            layer.msg('出错请稍后再试');
            }
            },
            function(){}
    );
    }
</script>